#!/bin/bash

read -p "stop all containers"
docker stop $(docker ps -a -q)

read -p "AppData tar"
rm -r ~/aid-tar
mkdir -p ~/aid-tar
for apppath in $(ls /aid); do
    appname=${apppath##*/}
    tar -cvf ~/aid-tar/${appname}.tar -C /aid ${appname}
done

read -p "start all containers"
docker start $(docker ps -a -q)
